<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/service/units/Unit.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/service/units/Unit.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'UnitId',
                footer: "Foots",
                cnName: '产品单位',
                name: 'units/Unit',
                url: "base-write/api/Unit/",
                sortName: "UnitId,Unitcode"
            });
            const editFormFields = ref({"Unitcode":"","UnitName":"","UnitRemark":""});
            const editFormOptions = ref([[{"title":"单位编号","field":"Unitcode","disabled":true},
                               {"title":"单位名称","field":"UnitName"},
                               {"title":"单位备注","field":"UnitRemark"}]]);
            const searchFormFields = ref({"Unitcode":""});
            const searchFormOptions = ref([[{"title":"单位编号","field":"Unitcode"}]]);
            const columns = ref([{field:'UnitId',title:'单位Id',type:'string',sort:true,width:220,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Unitcode',title:'单位编号',type:'string',sort:true,width:220,readonly:true,align:'left',sort:true},
                       {field:'UnitName',title:'单位名称',type:'string',width:220,align:'left'},
                       {field:'UnitRemark',title:'单位备注',type:'sbyte',width:110,align:'left'},
                       {field:'IsDeleted',title:'IsDeleted',type:'string',width:120,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
